<!DOCTYPE html>
<html>

	<head>
		<meta name="viewport" content="width=device-width-10, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
		<meta charset="utf-8" />

		<title>BAILINK</title>

		<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
		<script type="text/javascript" src="js/Bmob-2.2.51.min.js"></script>
		
		<style type="text/css">
			body{
				text-align: center;
			}
		</style>
		
	</head>

	<body>

		<div id="v_title">

		</div>

	</body>

	<script type="text/javascript">
		//初始化
		Bmob.initialize("a3655f301fb38457", "200011");

		//刷新数据到列表

		var ob = getQueryVariable("ob");

		const query = Bmob.Query("data");
		query.equalTo("objectId", '==', ob);
		//生成100个div

		//查询内容
		query.find().then(res => {
			try {

				document.title = res[0]['title'];
				$("#v_title").text("正在跳转到 " + res[0]['link']);
				window.location.href = res[0]['link'];

			} catch(e) {
				document.title = "参数错误";
				$("#v_title").text("参数错误，跳转失败！");
			}

		});

		//获取get传值参数
		function getQueryVariable(variable) {
			var query = window.location.search.substring(1);
			var vars = query.split("&");
			for(var i = 0; i < vars.length; i++) {
				var pair = vars[i].split("=");
				if(pair[0] == variable) {
					return pair[1];
				}
			}
			return(false);
		}
	</script>

</html>